/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Random;

/**
 * <p>Project: javase202202 - Arr3
 * <p>Powered by Lisi On 2022-06-02 16:05:25
 * <p>Created by IntelliJ IDEA
 *

 * @version 1.0
 * @since 17
 */
public class Arr3 {
    public static void main(String[] args) {
        Random rand = new Random();
        //Integer[] aa = new Integer[10];
        int[] bb = new int[10];
        for (int i = 0; i < bb.length; i++) {
            bb[i] = rand.nextInt(100 - 1 + 1) + 1;
        }

        //Arrays.toString(x[]) 返回一个字符串 参数为数组
        System.out.println(Arrays.toString(bb));
        System.out.println("-".repeat(35));
        for (int t : bb) {
            System.out.printf("%d ", t);
        }

        System.out.println();
        //判断一个元素是不是在某数组中
        String[] langs = {"java", "html", "css", "mysql", "python","php"};
        System.out.println(langs.length);


        //使用循环遍历，来检查数组中是不是有某元素
        for (int i = 0; i < langs.length; i++) {
            if("php".equals(langs[i])){
                System.out.printf("php在数组中存在，位置在langs[%d] = %s",i,langs[i]);
                break;
            }
        }

        //双色球 1-32 6



    }
}
